<?php 
    include_once('../../sys/sys.php');
    header('Content-Type: text/html; charset=utf-8');
?>
Ext.setup({
    tabletStartupScreen: 'tablet_startup.png',
    phoneStartupScreen: 'phone_startup.png',
    icon: 'icon.png',
    glossOnIcon: false,
    onReady : function() {
        Ext.regModel('Nl', {
            fields: ['nName', 'id']
        });
        
        
        
        
        var groupingBase = {
            itemTpl: '<div class="contact2"><font color="red"><strong>{nName}</strong></font></div>',
            selModel: {
                mode: 'SINGLE',
                allowDeselect: true
            },
            //grouped: true,
            //indexBar: true,

            onItemDisclosure: {
                scope: 'test',
                handler: function(record, btn, index) {
                //设置点击转向
                    //alert(record.get('id'));
                    window.location = record.get('id');
                }
            },
            store: new Ext.data.Store({
                model: 'Nl',
                
                proxy: {
                    type: 'ajax',
                    url : '<?php echo SITE_URL_MB; ?>mb178/get_pics.php<?php  echo '?tid=' . $_GET['tid']  ?>',
                    reader: {
                        type: 'json',
                        root: 'dat'
                    }
                },
                autoLoad: true,
            })
        };


        if (!Ext.is.Phone) {
            new Ext.List(Ext.apply(groupingBase, {
                floating: true,
                width: 350,
                height: 370,
                centered: true,
                modal: true,
                hideOnMaskTap: false
            })).show();
        }
        else {
            new Ext.List(Ext.apply(groupingBase, {
                fullscreen: true
            }));
        }
    }
});
